<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../header.jsp" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import ="java.util.*" %>

<script>
function update_room(R_NO){
	location.href=R_NO;
}
</script>

<div style="text-align: center">
		<ul id="admin_tab">
				<li id="admin_tab_1" class=""><a href="<%=path%>/adminIndex.admin"><strong>관리자 메인</strong></a></li>
				<li id="admin_tab_2" class="on"><a href="<%=path%>/admin_room.admin"><strong>객실 관리</strong></a></li>
				<li id="admin_tab_3" class=""><a href="<%=path%>/reservation.admin"><strong>예약 관리</strong></a></li>
				<li id="admin_tab_4" class=""><a href="<%=path%>/boardAdmin.admin"><strong>게시판 관리</strong></a></li>
		</ul>
</div>

					
<div id="report">
<br>
    <span class="title">ROOM LIST</span>
	<table class="room_list" cellpadding="0" cellspacing="0" border="0" width="100%" summary="어드민 객실리스트">
	    <colgroup>
                  <col width="10%">
                  <col width="150px">
                  <col width="20%">
                  <col width="10%">
                  <col width="10%">
                  <col width="10%">
                  <col width="30%">
                  <col width="20%">
                  <col width="12%">
        </colgroup>
		<thead>
			<tr>
				<td class="falst">객실번호</td>
				<td>객실사진</td>
				<td>객실이름</td>
				<td>면적</td>
				<td>최소인원</td>
				<td>최대인원</td>
				<td>옵션</td>
				<td>가격</td>
				<td>삭제</td>
			</tr>
		</thead>
		
		<tbody>
<c:forEach var="room" items="${list}">
				<tr>
					<td class="falst" onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')">${room.R_NO}</td>
					<td onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')"><img src="<%=path%>/images/${room.R_THUM}" alt="객실사진" style="width:150px;height:150px;"></td>
					<td onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')">${room.R_NAME}</td> <!-- 컨트롤러에 상품번호 값넘기기 -->
<%--<td><a href="<%=path %>/PageView.product?gno=${goods.gno}">${goods.goods_name}</a></td> --%>
					<td onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')">${room.R_SIZE}평</td>
					<td onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')">${room.R_MIN }</td>
					<td onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')">${room.R_MAX }</td>
					<td style="white-space: nowrap; padding: 30px;" onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')"><span>${room.R_OPTION }</span></td>
					<td onclick="javascript:update_room('<%=path%>/admin_detail_room.admin?Roomnumber=${room.R_NO}#insert_room')">${room.R_WEEK }</td>
					<td style="padding: 0 5px"> <input type="button" name="item_ck" value="삭제" onClick="location.href ='deleteRoom.admin?r_no=${room.R_NO}'"/></td>
				</tr>

</c:forEach>
			
		</tbody>
	</table>
	<br><br>
</div>


<div id="insert_room">
<span class="title">INSERT ROOM</span>
<form action="<%=path%>/insertRoom.admin" method="post" enctype="multipart/form-data"  id="insert_room" name="insert_room" >

		<table class="insert_room" cellpadding="0" cellspacing="0" border="0" width="100%" summary="객실 추가하기">
			<tr>
				<th><label for="R_NAME" class="label">객실이름</label></th>
				<td>
				<input name="R_NAME" id="R_NAME" type="text"/>
				</td>
			</tr>		
			<tr>
				<th><label for="R_SIZE" class="label">면적</label></th>
				<td><input name="R_SIZE" id="R_SIZE" type="text" /></td>
			</tr>	
			<tr>
				<th><label for="R_MIN" class="label">최소인원</label></th>
				<td><input name="R_MIN" id="R_MIN" type="text" /></td>
			</tr>
			<tr>
				<th><label for="R_MAX" class="label">최대인원</label></th>
				<td><input name="R_MAX" id="R_MAX" type="text" value="" /></td>
			</tr>
			<tr>
				<th><label for="R_OPTION" class="label">옵션</label></th>
				<td><input name="R_OPTION" id="R_OPTION" type="text" value="" /></td>
			</tr>
			<tr>
				<th><label for="R_WEEK" class="label">가격</label></th>
				<td><input name="R_WEEK" id="R_WEEK" type="text" value="" /></td>
			</tr>
			<tr>
				<th><label for="R_THUM" class="label">객실 썸네일</label></th>
				<td>
				<input name="R_THUM" id="R_THUM" type="file" class="required" title="썸네일 이미지를 등록하세요" />
				</td>
			</tr>
			
			<tr>
				<th><label for="R_PATH" class="label">객실 사진</label></th>
				<td><input name="R_PATH" id="R_PATH" type="file" class="required" title="썸네일 이미지를 등록하세요" /></td>
			</tr>
			
		</table>
	
	<div class="btn_submit" style="display:inline; float:right;">
		<!-- <input type="button" name="submit" value="취소" /> -->
		취소
	</div>
	<div class="btn_submit" style="display:inline; float:right; border-left:1px solid #b4b2a4;" onclick="javascript:document.insert_room.submit()">
		<!-- <input type="submit" name="submit" value="등록" /> -->
		등록
	</div>
</form>

<br><br><br><br><br>
</div>

<%@include file="../footer.jsp" %>